Important configs from postgresql.conf (identical on both environments)
 
show shared_buffers;
 shared_buffers 
----------------
 8GB
(1 row)

mavmail=# show work_mem;
 work_mem 
----------
 64MB
(1 row)

mavmail=# show maintenance_work_mem 
mavmail-# ;
 maintenance_work_mem 
----------------------
 4GB
(1 row)
 default_statistics_target           | 100   
   effective_cache_size                | 10GB
   enable_bitmapscan                   | on                                                                                                                                               
 enable_hashagg                      | on                                                                                                                                               
  enable_hashjoin                     | on                                                                                                                                               
 enable_indexonlyscan                | on                                                                                                                                               
 enable_indexscan                    | on                                                                                                                                               
 enable_material                     | on                                                                                                                                               
 enable_mergejoin                    | on                                                                                                                                               
 enable_nestloop                     | on                                                                                                                                               
 enable_seqscan                      | on                                                                                                                                               
 enable_sort                         | on                                                                                                                                               
 enable_tidscan                      | on